package com.yunyi.lam.demo;

import com.yunyi.lam.pojo.Author;
import com.yunyi.lam.utils.GetAuthors;

import java.util.List;

/**
 * demo展示
 */
public class Demo01 {


    public static void main(String[] args) {
        List<Author> authors = GetAuthors.getAuthors();
        //把集合转换成了流
        authors.stream()
                .distinct()//去重
                .filter(author -> author.getAge() < 13)//筛选
                .forEach(author -> System.out.println(author.getName()));//循环
        System.out.println(authors);
    }


}
